﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AgentSite.Master" AutoEventWireup="true" CodeBehind="CreateOrder.aspx.cs" Inherits="Agents.Agent.CreateOrder" %>
<asp:Content ID="Header" ContentPlaceHolderID="Header" runat="server">
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    <h1>
        ביצוע הזמנה
    </h1> 
    <h4>
        אנא מלא פרטי הזמנה עבור 
        <asp:Label ID="nameLbll" runat="server" />
        :
    </h4>  
    <asp:ScriptManager ID="ScriptManager1" runat="server" />  
    <asp:Timer ID="redirectionTimer" runat="server" Interval="2000" Enabled="false" 
        ontick="redirectionTimer_Tick" />             
    <hr />    
    <asp:Panel ID="gridPanel" runat="server" Height="300px" Width="100%" ScrollBars="Vertical"> 
        <asp:DataGrid runat="server" ID="dgProducts" AutoGenerateColumns="False"
                BackColor="White" BorderStyle="None" DataSourceID="SqlDataSource1"
                CellPadding="3" GridLines="Both" Height="500px" 
                CssClass="dataGrid" Font-Names="Verdana" BorderColor="#999999" BorderWidth="1px">
            <AlternatingItemStyle BackColor="#DCDCDC" />
            <Columns>
                <asp:BoundColumn DataField="Id" Visible="false" />
                <asp:BoundColumn DataField="Name" HeaderText="שם" HeaderStyle-Width="50%" ItemStyle-Width="50%" FooterStyle-Width="50%" />
                <asp:BoundColumn DataField="Price" HeaderText="מחיר" HeaderStyle-Width="25%" ItemStyle-Width="25%" FooterStyle-Width="25%" />
                <asp:TemplateColumn HeaderText="כמות" HeaderStyle-Width="20%" ItemStyle-Width="20%" FooterStyle-Width="20%">
                <ItemTemplate>
                    <asp:TextBox ID="txtNumItems" Text="0" runat="server" TextMode="Number" />
                </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
            <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
            <ItemStyle BackColor="White" ForeColor="Black" />
            <PagerStyle Mode="NumericPages" BackColor="#999999" ForeColor="Black" HorizontalAlign="Center"></PagerStyle>
            <SelectedItemStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
        </asp:DataGrid>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:AgentConnectionString %>" 
            SelectCommand="SELECT [Id], [Name], [Price] FROM [Products] ORDER BY [Name]">
        </asp:SqlDataSource>
    </asp:Panel>   

    <br /> 
    <h4>
        <asp:Button ID= "sumBtn" Text= "חשב סכום לתשלום" runat= "server" 
            onclick="sumBtn_Click" CssClass="button"/>
        <br>
        <asp:Label ID="sumMessage" runat="server" /> 
        <asp:Label ID="sumLable" runat="server" />
                
        <br>
        <asp:Label ID="taxSumMessage" runat="server" /> 
        <asp:Label ID="taxSumLable" runat="server" />

        <br>
        <asp:Label ID="ClientSumMessage" runat="server" /> 
        <asp:Label ID="ClientSumLable" runat="server" />
        <br />
        <asp:Label ID="lblStockProblems" runat="server" ForeColor="Red" Font-Bold="false" />
    </h4> 
    <table>
        <tr>
            <td>
                <asp:Label ID="Label1" Text="הערות:" runat="server" />        
            </td>
            <td>
                <asp:TextBox ID="commentsTxtbox" TextMode="MultiLine" runat="server" />
            </td>
        </tr>
    </table>    
    <hr />
    <div class="alignCenter">               
        <asp:Button ID="createOrderBtn" Text="בצע הזמנה וסיים" runat="server" 
            onclick="createOrderBtn_Click" CssClass="button"/>
        <asp:Button ID="cancelOrderBtn" Text="ביטול" runat="server" 
            onclick="cancelOrderBtn_Click" CssClass="button"/>
    </div>
</asp:Content>
